﻿namespace System.ComponentModel.Composition.SilverlightControlExtensions.Infrastructure
{
    using System.ComponentModel.Composition.Primitives;

    public class AssemblyCatalog : XamlCatalog
    {
        public string Assembly { get; set; }

        public override ComposablePartCatalog InnerCatalog
        {
            get
            {
                Hosting.AssemblyCatalog catalog = null;
                if (!string.IsNullOrEmpty(this.Assembly))
                {
                    catalog = new Hosting.AssemblyCatalog(Reflection.Assembly.Load(this.Assembly));
                }

                return catalog;
            }
        }
    }
}